package com.example.mall_system.mapper;

import com.example.mall_system.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    int insert(Order order);
    Order selectById(@Param("id") Long id);
    Order selectByOrderNumber(String orderNumber);
    List<Order> selectByUserId(@Param("userId") Long userId);
    List<Order> selectByUserIdAndStatus(@Param("userId") Long userId, @Param("status") Integer status);
    int updateStatus(Order order);
    int updatePaymentInfo(Order order);
    int updateAddress(@Param("orderId") Long orderId, @Param("addressId") Long addressId);
}